import req from '@/utils/request'
const baseURL = process.env.VUE_APP_BASE_URL
export function getDeviceGroupDetails(deviceGroupToken) {
    return req({
        method: 'get',
        url: baseURL + "/superlink/api/devicegroups/" + deviceGroupToken,
    })
}
export function delDeviceGroup(deviceGroupToken) {
    return req({
        method: 'delete',
        url: baseURL + "/superlink/api/devicegroups/" + deviceGroupToken,
    })
}
export function getDeviceGroupLists(params) {
    return req({
        method: 'get',
        url: baseURL + '/superlink/api/devicegroups',
        params
    })
}
export function addDevicegroupsElements(data, deviceGroupTokens) {
    return req({
        method: 'post',
        url: baseURL + "/superlink/api/devicegroups/" + deviceGroupTokens + "/elements",
        data
    })
}
export function getDeviceElements(params, deviceGroupTokens) {
    return req({
        method: 'get',
        url: baseURL + "/superlink/api/devicegroups/" + deviceGroupTokens + "/elements",
        params
    })
}
export function delDeviceElements(id, deviceGroupTokens) {
    return req({
        method: 'delete',
        url: baseURL + "/superlink/api/devicegroups/" +
            deviceGroupTokens +
            "/elements/" +
            id,
    })
}
export function addDeviceElements(data) {
    return req({
        method: 'post',
        url: baseURL + "/superlink/api/devicegroups",
        data
    })
}
export function putDeviceElements(data, token) {
    return req({
        method: 'put',
        url: baseURL + "/superlink/api/devicegroups/" + token,
        data
    })
}

